﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdCmTransparency : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdCmTransparency(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdCmTransparency obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdCmTransparency()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdCmTransparency(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdCmTransparency() : this(GlobalsPINVOKE.new_OdCmTransparency__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmTransparency(byte alpha) : this(GlobalsPINVOKE.new_OdCmTransparency__SWIG_1(alpha), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmTransparency(double alphaPercent) : this(GlobalsPINVOKE.new_OdCmTransparency__SWIG_2(alphaPercent), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmTransparency(OdCmTransparency transparency) : this(GlobalsPINVOKE.new_OdCmTransparency__SWIG_3(OdCmTransparency.getCPtr(transparency)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmTransparency Assign(OdCmTransparency transparency)
		{
			OdCmTransparency result = new OdCmTransparency(GlobalsPINVOKE.OdCmTransparency_Assign(this.swigCPtr, OdCmTransparency.getCPtr(transparency)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdCmTransparency transparency)
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_IsEqual(this.swigCPtr, OdCmTransparency.getCPtr(transparency));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdCmTransparency transparency)
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_IsNotEqual(this.swigCPtr, OdCmTransparency.getCPtr(transparency));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAlpha(byte alpha)
		{
			GlobalsPINVOKE.OdCmTransparency_setAlpha(this.swigCPtr, alpha);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public byte alpha()
		{
			byte result = GlobalsPINVOKE.OdCmTransparency_alpha(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAlphaPercent(double alphaPercent)
		{
			GlobalsPINVOKE.OdCmTransparency_setAlphaPercent(this.swigCPtr, alphaPercent);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double alphaPercent()
		{
			double result = GlobalsPINVOKE.OdCmTransparency_alphaPercent(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdCmTransparency.transparencyMethod method()
		{
			OdCmTransparency.transparencyMethod result = (OdCmTransparency.transparencyMethod)GlobalsPINVOKE.OdCmTransparency_method(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setMethod(OdCmTransparency.transparencyMethod method)
		{
			GlobalsPINVOKE.OdCmTransparency_setMethod(this.swigCPtr, (int)method);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isByAlpha()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isByAlpha(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isByBlock()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isByBlock(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isByLayer()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isByLayer(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInvalid()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isInvalid(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isClear()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isClear(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isSolid()
		{
			bool result = GlobalsPINVOKE.OdCmTransparency_isSolid(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint serializeOut()
		{
			uint result = GlobalsPINVOKE.OdCmTransparency_serializeOut(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void serializeIn(uint transparency)
		{
			GlobalsPINVOKE.OdCmTransparency_serializeIn(this.swigCPtr, transparency);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;

		public enum transparencyMethod
		{
			kByLayer,
			kByBlock,
			kByAlpha,
			kErrorValue
		}
	}
}
